package cn.qzbook.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author zc
 * @Date 2020/12/13 下午5:36
 */
@RestController
public class ProviderPaymentController {

    private final String BASE_PATH = "http://PAYMENT-SERVER";

    @Autowired
    private RestTemplate template;

    @GetMapping("customer/host")
    public String rest(){
        Map<String,String> map = new HashMap<>();
        String forObject = template.getForObject(BASE_PATH + "/host", String.class);
        return forObject;
    }

    @GetMapping("customer/get")
    public String get(){
        Map<String,String> map = new HashMap<>();
        String forObject = template.getForObject(BASE_PATH + "/get", String.class);
        return forObject;
    }

}
